<template>
  <div id="app">
    <!-- <keep-alive>
      <router-view v-if="$route.meta.keepAlive" />
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive" /> -->
    <!-- <router-view v-if="isTokenLoad" /> -->
    <router-view />
    <div class="fixedBox"></div>

    <!-- <button @click="test">打印</button> -->
  </div>
</template>
<script>
import * as dd from "dingtalk-jsapi";
import { login } from "@/utils/login";
import { checkUpgrade } from "@/appVersion/upgrade.js";

export default {
  name: "App",
  data() {
    return {
      isTokenLoad: false,
    };
  },
  created() {
    login()
      .then((res) => {})
      .catch((err) => {});

    document.addEventListener(
      "deviceready",
      () => {
        window.cordova.getAppVersion.getVersionNumber().then((version) => {
          checkUpgrade(version);
        });
      },
      false
    );
  },
  methods: {
    ismobile(test) {
      var u = navigator.userAgent,
        app = navigator.appVersion;
      if (
        /AppleWebKit.*Mobile/i.test(navigator.userAgent) ||
        /MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(
          navigator.userAgent
        )
      ) {
        if (window.location.href.indexOf("?mobile") < 0) {
          try {
            if (/iPhone|mac|iPod|iPad/i.test(navigator.userAgent)) {
              return "0";
            } else {
              return "1";
            }
          } catch (e) {}
        }
      } else if (u.indexOf("iPad") > -1) {
        return "0";
      } else {
        return "1";
      }
    },

    init() {
      const type =
        "orientationchange" in window ? "orientationchange" : "resize";
      const doc = window.document;
      if (doc.addEventListener) {
        window.addEventListener(type, this.resize, !1);
        doc.addEventListener("DOMContentLoaded", this.resize, !1);
      }
      this.resize();
      // this.$store.commit("initLocale");
    },
    resize() {
      const w = document.body.offsetWidth;
      window.document.documentElement.style.fontSize = (w / 375) * 100 + "px";
    },
    touchstart(event) {
      event.preventDefault(); //阻止默认事件（长按的时候出现复制）

      this.startX = event.changedTouches[0].pageX;
      this.startY = event.changedTouches[0].pageY;
    },
    touchmove(event) {
      // 如果手指有移动，则取消所有事件，此时说明用户只是要移动而不是长按
      event.preventDefault();

      var moveEndX = event.changedTouches[0].pageX;
      var moveEndY = event.changedTouches[0].pageY;
      var X = moveEndX - this.startX;
      var Y = moveEndY - this.startY;
      if (Math.abs(X) > Math.abs(Y) && X > 0) {
        console.log("左滑");
      }
    },
  },
};
</script>
<style lang="scss">
@import "@/assets/base.scss";
@import "@/assets/theme.scss";
* {
  /* font-size: 12px; */
  margin: 0;
  padding: 0;
}
.van-nav-bar .van-icon {
  color: #030303;
}
#app {
  background: rgb(245, 245, 245);
  // background: green;
  height: 100%;
  // padding-bottom: 0.65rem;
}

input::-webkit-input-placeholder {
  /* WebKit browsers */
  color: $placeholder !important;
}
// .fixedBox{
//   position: fixed;
//   bottom: 0;
//   width: 100%;
//   height: constant(safe-area-inset-bottom);
//   height: env(safe-area-inset-bottom);
//   background-color: red;
// }

/* 适配iphoneX顶部填充*/
@supports (top: env(safe-area-inset-top)) {
  body,
  .header {
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top);
  }
}
/* 判断iphoneX 将 footer 的 padding-bottom 填充到最底部 */
@supports (bottom: env(safe-area-inset-bottom)) {
  body,
  .footer {
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

input::-webkit-input-placeholder {
  color: $fontColortxt !important;
  /* font-size:$font15; */
}
input:-ms-input-placeholder {
  color: $fontColortxt !important;
} /* Internet Explorer 10+ */

input::-webkit-input-placeholder {
  color: $fontColortxt !important;
} /* WebKit browsers */

input::-moz-placeholder {
  color: $fontColortxt !important;
} /* Mozilla Firefox 4 to 18 */

input:-moz-placeholder {
  color: $fontColortxt !important;
} /* Mozi
.wrap-apply .label[data-v-0089a188] {
    padding: 0px 16px;
    padding-top: 14px;
    padding-bottom: -10px;
    color: $color4;
    font-weight: 400;
}
.van-tabs__line {
  
    height: 3px;
    border-radius:0px;
}



/*公共样式 */
.van-cell::after {
  border-bottom: none;
}
.scroll-line {
  height: 20px;
  background: rgb(244, 244, 244);
}
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.van-button {
  border-radius: 6px !important;
}
.van-popover__action {
  width: 135px;
}
</style>
